from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    #android uiautomator
    #搜索内容
    def sosuo(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜商品名称 作者 出版社 ISBN")')
        ele=self.find_ele(loc)
        return ele
    #输入搜索内容
    def srssnr(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    #accessibility id
    #返回
    def fh(self):
        loc=(By.ACCESSIBILITY_ID,'返回')
        ele=self.find_ele(loc)
        return ele
    #点击搜索按钮
    def djssan(self):
        loc=(By.ID,'com.kongfz.app:id/tvSearch')
        ele=self.find_ele(loc)
        return ele
    #点击图片
    def djtp(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/ivPic"])[7]')
        ele=self.find_ele(loc)
        return ele
    #加入购物车
    def jrgwc(self):
        loc=(By.ID,'com.kongfz.app:id/tvAddCart1')
        ele=self.find_ele(loc)
        return ele
    #点击返回
    def djfh(self):
        loc=(By.XPATH,'//androidx.compose.ui.platform.ComposeView[@resource-id="com.kongfz.app:id/compose_view"]/android.view.View/android.view.View[2]/android.view.View[1]')
        ele=self.find_ele(loc)
        return ele
    #断言综合
    def zh(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("综合")')
        ele=self.find_ele(loc)
        return ele
    #断言价格
    def jg(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("价格")')
        ele=self.find_ele(loc)
        return ele

